This HyperCard stack by Oscar van Vlijmen computes many statistical functions with high accuracy and usable for large numbers. Included are many combinatorial functions, many PDFs (probability density) and CDFs (cumulative distribution), plus several special functions such as Erlang B+C network traffic, factorial, modified Bessel, (in)complete gamma & beta.
Much more info in the stack. Here an abstract.
What is a stack?
------------
A stack is a HyperCard document. HyperCard is a Macintosh application program from Apple Computer. A free player for stacks is provided with every Mac. If you want to change scripts in a stack, you need the development kit, which can be bought from an Apple reseller.
The latest version 2.4.1 of the HyperCard player can be downloaded from:
On each card you will find a button that can give an answer to a combinatorial problem or that can compute a chance, that’s to say a probability density function (PDF) or a cumulative distribution function (CDF).
Several special functions, used in this stack, can be calculated separately.
You can use this stack as a replacement for statistical tables. Calculations are very precise and you can enter relatively large numbers.
What you can compute
----------------
The following combinatorial computations are possible:
• Combinations
• Drawing with or without putting back (replacement)
• Multiple permutations
• Permutations (and weirdly big factorials!)
• Variations
The following probabilities (PDFs) can be computed:
• Alternative distribution
• Binomial distribution (e.g. football toto)
• Discrete uniform distribution
• Drawing probability in general, i.e. hypergeometric distribution (application: Lucky 10)
• Geometric distribution
• Lotto (special case of hypergeometric)
• Multinomial distribution
• Negative binomial distribution
• Normal distribution
• Poisson distribution
Furthermore the following cumulative distribution functions (CDFs) can be computed:
• Beta
• Binomial
• Cauchy
• Chi square
• Erlang
• Gamma
• Hypergeometric
• Inverse of standard normal
• Inverse-normal CDF
• Logistic
• Negative binomial
• Negative exponential
• Rayleigh
• Snedecor-F
• Standard normal
• Student-T
• Tukey-lambda
• Von Mises
Plus the following special functions, used in this stack, can be computed:
• Beta function
• Gamma function
• Erlang B and C network traffic
• Error function
• Factorial
• Incomplete beta function
• Incomplete gamma function
• Modified Bessel functions of the first kind and integer order
Where appropriate and known the expected value, variance and spread (standard deviation) are given. In the case of probabilities, you also get the reciprocal of the probability.
Better than book with tables
--------------------
So, you don’t need any longer a book of statistical tables. No longer you have to approximate a distribution with a normal distribution. You can compute all probabilities with high accuracy.
Statistical tables are pretty coarse and do not go very far. What is better than a HyperCard stack with a nice user interface?
Big numbers
----------
A nice feature is that you can work with very large numbers - not in the sense of many digits but large values. Can be interesting for statistical thermodynamics or other theoretical fields.
Look at the cards with ‘Drawing with putting back’ and ‘Permutations’.
Here you can respectively compute large powers or large factorials (up to 10 E 305 or so, yes the factorial of this!).
Factorials are computed with Stirling’s approximation. A very comprehensive description can be found in: ‘Concrete mathematics’, Graham, Knuth, Patashnik; Addison-Wesley, 4th ed. 1990, § 9.6.
Since gamma(x+1) = x! you could in theory use Stirling to compute the gamma function because the ‘Permutations’ button is not restricted to integers. But the Stirling approximation is not so good for x let’s say smaller than 10. Computations using the gamma function use a more accurate function in the background script.
Accuracy
--------
Although one of HyperCard’s worst omissions is the inability to produce a scientific notation of numbers, the full accuracy of ‘double floats’ from the Macintosh SANE or PowerPC Numerics math library is used. With SANE (68K Mac or HyperCard 2.1) you can compute up to 10E4932 with a precision of 18-19 digits, and with PowerPC Numerics (MathLib, Power Macintosh and HyperCard ≥2.3) you can compute up to 10E308 with a precision of 15-16 digits. But unfortunately we have to make ourselves a scientific notation with the ln-function, a process which loses 1-3 digits accuracy. Still enough for statistics though.
Not fool proof
----------
This stack is kept pretty simple with no frills and with very little input checking. It’s easy to enter garbage and to produce meaningless results or HyperCard error messages (e.g. can’t take the value of that expression, NAN(000), etc.).
Another point: this stack is NOT a course in statistics, only a calculator with short explanations. Buy one of the many good text books on statistics.
Localization remark
---------------
HyperCard works with its own number representation, even if you have configured your system with Control Panel ‘Numbers’ or similar with another decimal sign. So, use for this stack a point for decimal separator and nothing for thousands separator.
Version history
------------
* 1.1.0. First public release in Dutch language.
(I mean, you know, I’m like Dutch!)
* 1.2.0. Many functions added; output enhanced.
* 2.0.1. Many small improvements. Expected value, variance, spread added. Checked with HyperCard 2.4.1 and Mac OS 8.1. The stack should still work with HyperCard 2.1.
* 2.1.0E. First English translation. Some improvements.
* 2.2. Erlang B&C text augmented with Poisson and binomial traffic models.
Distributions added (Tukey-lambda, logistic, cumulative hypergeometric, Von Mises).
Separate cards for some of the used special functions (gamma, beta, incomplete gamma & beta, modified Bessel functions).
You know the drill: this stack is for free, but I own the intellectual rights and all commercial rights, and legally you can’t do anything serious with it.
Formulas and algorithms are of course not copyrightable, complete applications of these however, are.
The author of this stack cannot be held responsible for the consequences of using or not being able to use this stack or parts of it. Despite the care with which this stack has been put together, there is no guarantee that any comments are correct, any calculations are correct, the algorithms that lie behind the calculations are correct nor any functionality is correct. You receive this software ‘as is’.
This stack may be used and distributed for free if in non-commercial applications, but may not be used in or distributed for commercial applications of any kind, including the selling of CD-ROMs or charged Internet/intranet or BBS site services. This stack or parts of it may not be sold or traded by others than Oscar van Vlijmen, i.e. the author, or his representatives. Parts of this stack - e.g. scripts - may be in complete or partially used in other non-commercial applications, but only if in the used parts expressed copyright statements regarding the author are not deleted. If the original parts are changed significantly, then of course author is no longer able to claim copyright.